package com.spt.springbootzhsx.service.suggest.Get_Sum_StepFive_6;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

/*
 **@Author:邓少勋
 **Created on 2022-06-10
 */
public class FiveSum_Main {
    public static void domain() throws Exception {
        Configuration conf = new Configuration();

        Job job=Job.getInstance(conf,"对推荐结果求和");
        job.setJarByClass(FiveSum_Main.class);
        job.setMapperClass(FiveSum_Mapper.class);
        job.setReducerClass(FiveSum_Reducer.class);
        job.setMapOutputKeyClass(Text.class);
        job.setMapOutputValueClass(DoubleWritable.class);
        FileInputFormat.setInputPaths(job,new Path("src/main/java/com/spt/springbootzhsx/service/suggest/suggestOut/output/step05/part-r-00000"));
        FileOutputFormat.setOutputPath(job,new Path("src/main/java/com/spt/springbootzhsx/service/suggest/suggestOut/output/step06"));
        job.waitForCompletion(true);
    }
}
